package com.abk.ets.data;

// Generated 26 avr. 2013 10:28:47 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Offre generated by hbm2java
 */
@Entity
@Table(name = "offre", catalog = "etsdatabase")
public class Offre implements java.io.Serializable {

	private int idOffre;
	private Contrat contrat;
	private Investisseur investisseur;
	private String typeOffre;
	private Date dateOffre;
//	private Set transactions = new HashSet(0);

	public Offre() {
	}

	public Offre(int idOffre, Investisseur investisseur, String typeOffre,
			Date dateOffre) {
		this.idOffre = idOffre;
		this.investisseur = investisseur;
		this.typeOffre = typeOffre;
		this.dateOffre = dateOffre;
	}

//	public Offre(int idOffre, Contrat contrat, Investisseur investisseur,
//			String typeOffre, Date dateOffre, Set transactions) {
//		this.idOffre = idOffre;
//		this.contrat = contrat;
//		this.investisseur = investisseur;
//		this.typeOffre = typeOffre;
//		this.dateOffre = dateOffre;
//		this.transactions = transactions;
//	}

	@Id
	@Column(name = "idOffre", unique = true, nullable = false)
	public int getIdOffre() {
		return this.idOffre;
	}

	public void setIdOffre(int idOffre) {
		this.idOffre = idOffre;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idContrat")
	public Contrat getContrat() {
		return this.contrat;
	}

	public void setContrat(Contrat contrat) {
		this.contrat = contrat;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idInvestisseur", nullable = false)
	public Investisseur getInvestisseur() {
		return this.investisseur;
	}

	public void setInvestisseur(Investisseur investisseur) {
		this.investisseur = investisseur;
	}

	@Column(name = "typeOffre", nullable = false, length = 5)
	public String getTypeOffre() {
		return this.typeOffre;
	}

	public void setTypeOffre(String typeOffre) {
		this.typeOffre = typeOffre;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateOffre", nullable = false, length = 10)
	public Date getDateOffre() {
		return this.dateOffre;
	}

	public void setDateOffre(Date dateOffre) {
		this.dateOffre = dateOffre;
	}

//	@OneToMany(fetch = FetchType.LAZY, mappedBy = "offre")
//	public Set getTransactions() {
//		return this.transactions;
//	}
//
//	public void setTransactions(Set transactions) {
//		this.transactions = transactions;
//	}

}
